#include <stdio.h>
typedef struct Student 
{
 int num;
 char name[10];
 int score[3];
 struct Student *next;
}Student;

int main()
{   void input(Student *p);
    void output(Student *p);
    Student a,b,c,d,e,*head,*p;
    head=&a;
    a.next=&b;
    b.next=&c;
    c.next=&d;
    d.next=&e;
    e.next=NULL;
    input(head);
    output(head);
    return 0;
}
void input(Student *p)
{
    while (p != NULL)
    {
        printf("请输入学号: ");
        scanf("%d", &(p->num));
        printf("请输入姓名: ");
        scanf("%s", p->name);
        printf("请输入三门课程成绩: ");
        scanf("%d %d %d", &(p->score[0]), &(p->score[1]), &(p->score[2]));
        p = p->next;
    }
}
void output(Student *p)
{
    while (p != NULL)
    {
        printf("学号: %d\n", p->num);
        printf("姓名: %s\n", p->name);
        printf("成绩: %d %d %d\n", p->score[0], p->score[1], p->score[2]);
        p = p->next;
    }
}